home *** CD-ROM | disk | FTP | other *** search
/ Network CD 2 / Network CD - Volume 2.iso / programs / internet / tcp / amitcp / amitcp-api-22.lha / AmiTCP-2.2 / netinclude / clib / socket_protos.h < prev   
Encoding:
C/C++ Source or Header  |  1993-08-12  |  4.8 KB  |  148 lines

  1. #ifndef CLIB_SOCKET_PROTOS_H
  2. #define CLIB_SOCKET_PROTOS_H
  3.  
  4. /*
  5.  * $Id: socket_protos.h,v 1.15 1993/08/05 21:01:58 jraja Exp $
  6.  *
  7.  * Copyright © 1993 AmiTCP/IP Group, <amitcp-group@hut.fi>
  8.  *                  Helsinki University of Technology, Finland.
  9.  *                  All rights reserved.
  10.  *
  11.  * Prototypes for AmiTCP/IP bsdsocket.library
  12.  *
  13.  * HISTORY
  14.  * $Log: socket_protos.h,v $
  15.  * Revision 1.15  1993/08/05  21:01:58  jraja
  16.  * Fixed error in Release(CopyOf)Socket()s arguments (were in opposite order).
  17.  *
  18.  * Revision 1.14  1993/06/11  19:12:29  too
  19.  * Changed name of ioctl to IoctlSocket. Added prototype for Dup2Socket()
  20.  *
  21.  * Revision 1.13  1993/06/04  11:38:27  jraja
  22.  * Fixes for the first release.
  23.  *
  24.  * Revision 1.12  1993/05/24  19:35:43  ppessi
  25.  * syslog tagfunc added.
  26.  *
  27.  * Revision 1.11  1993/05/23  17:41:41  ppessi
  28.  * Changed Perror() to PrintNetFault().
  29.  *
  30.  * Revision 1.10  1993/05/20  14:30:58  ppessi
  31.  * Added a few netlib routines.
  32.  *
  33.  * Revision 1.9  1993/05/16  23:57:04  ppessi
  34.  * Added some Netlib functions.
  35.  *
  36.  * Revision 1.8  1993/05/04  13:17:13  jraja
  37.  * Added name to the first argument of recvfrom().
  38.  *
  39.  * Revision 1.7  93/05/04  12:56:56  12:56:56  jraja (Jarno Tapio Rajahalme)
  40.  * Changed SetErrno() to SetErrnoPtr().
  41.  * 
  42.  * Revision 1.6  93/04/29  02:20:06  02:20:06  jraja (Jarno Tapio Rajahalme)
  43.  * Added prototype for rresvport().
  44.  * 
  45.  * Revision 1.5  93/04/27  10:31:07  10:31:07  puhuri (Markus Peuhkuri)
  46.  * Add proto for Syslog().
  47.  * 
  48.  * Revision 1.4  93/04/13  21:52:56  21:52:56  jraja (Jarno Tapio Rajahalme)
  49.  * Removed inclusion of sys/socket.h (not needed).
  50.  * Fixed type (unsigned LONG to ULONG).
  51.  * 
  52.  * Revision 1.3  93/04/06  18:02:58  18:02:58  ppessi (Pekka Pessi)
  53.  * Fixed types. Added arpa/inet functions, netdb functions, async IO funcs.
  54.  * 
  55.  * Revision 1.2  93/04/06  15:25:08  15:25:08  ppessi (Pekka Pessi)
  56.  * *** empty log message ***
  57.  * 
  58.  * Revision 1.1  93/03/22  01:07:40  01:07:40  ppessi (Pekka Pessi)
  59.  * Initial revision
  60.  * 
  61.  */
  62.  
  63. #ifndef EXEC_TYPES_H
  64. #include <exec/types.h>
  65. #endif
  66.  
  67. #ifndef SYS_TYPES_H
  68. #include <sys/types.h>
  69. #endif
  70.  
  71. #ifndef SYS_TIME_H
  72. #include <sys/time.h>
  73. #endif
  74.  
  75. #ifndef SYS_SOCKET_H
  76. #include <sys/socket.h>
  77. #endif
  78.  
  79. #ifndef IN_H
  80. #include <netinet/in.h>
  81. #endif
  82.  
  83. #include <stdarg.h>
  84.  
  85. LONG socket(LONG domain, LONG type, LONG protocol);
  86. LONG bind(LONG s, const struct sockaddr *name, LONG namelen);
  87. LONG listen(LONG s, LONG backlog);
  88. LONG accept(LONG s, struct sockaddr *addr, LONG *addrlen);
  89. LONG connect(LONG s, const struct sockaddr *name, LONG namelen);
  90. LONG sendto(LONG s, char *msg, LONG len, LONG flags, 
  91.         struct sockaddr *to, LONG tolen);
  92. LONG send(LONG s, const char *msg, LONG len, LONG flags);
  93. LONG recvfrom(LONG s, char *buf, LONG len, LONG flags, 
  94.           struct sockaddr *from, LONG *fromlen);
  95. LONG recv(LONG s, char *buf, LONG len, LONG flags);
  96. LONG shutdown(LONG s, LONG how);
  97. LONG setsockopt(LONG s, LONG level, LONG optname, char *optval, LONG optlen);
  98. LONG getsockopt(LONG s, LONG level, LONG optname, char *optval, LONG *optlen);
  99. LONG getsockname(LONG s, struct sockaddr *name, LONG *namelen);
  100. LONG getpeername(LONG s, struct sockaddr *name, LONG *namelen);
  101.  
  102. LONG IoctlSocket(LONG d, ULONG request, char *argp);
  103. LONG CloseSocket(LONG d);
  104. LONG WaitSelect(LONG nfds, fd_set *readfds, fd_set *writefds, fd_set *exeptfds, struct timeval *timeout, ULONG *maskp);
  105.  
  106. LONG Dup2Socket(LONG fd1, LONG fd2);
  107.  
  108. LONG SetDTableSize(LONG size);
  109. void SetSocketSignals(ULONG SIGINTR, ULONG SIGIO, ULONG SIGURG);
  110. LONG Errno(void);
  111. void SetErrnoPtr(void *errno_p, LONG size);
  112. LONG ObtainSocket(LONG id, LONG domain, LONG type, LONG protocol);
  113. LONG ReleaseSocket(LONG fd, LONG id);
  114. LONG ReleaseCopyOfSocket(LONG fd, LONG id);
  115.  
  116. /* Arpa/inet functions */
  117. ULONG inet_addr(const char *);
  118. ULONG inet_network(const char *);
  119. char *Inet_NtoA(ULONG s_addr);
  120. ULONG Inet_MakeAddr(int , int);
  121. ULONG Inet_LnaOf(LONG s_addr);
  122. ULONG Inet_NetOf(LONG s_addr);
  123.  
  124. /* NetDB functions */
  125. struct hostent  *gethostbyname(const char *name);
  126. struct hostent  *gethostbyaddr(const char *addr, LONG len, LONG type);
  127. struct netent   *getnetbyname(const char *name);
  128. struct netent   *getnetbyaddr(LONG net, LONG type);
  129. struct servent  *getservbyname(const char *name, const char *proto);
  130. struct servent  *getservbyport(LONG port, const char *proto);
  131. struct protoent *getprotobyname(const char *name);
  132. struct protoent *getprotobynumber(LONG proto);
  133.  
  134. /* Syslog functions */
  135. void syslog(ULONG level, const STRPTR format, ...);
  136. void Syslog(ULONG level, const STRPTR format, LONG *);
  137.  
  138. /* Netlib Functions */
  139. int getopt(int argc, char **argv, char *opts);
  140. void PrintNetFault(LONG code, const UBYTE *banner);
  141. LONG select(LONG nfds, fd_set *readfds, fd_set *writefds, fd_set *exeptfds, struct timeval *timeout);
  142. char *inet_ntoa(struct in_addr);
  143. struct in_addr inet_makeaddr(int , int);
  144. unsigned long inet_lnaof(struct in_addr);
  145. unsigned long inet_netof(struct in_addr);
  146. #endif /* !CLIB_SOCKET_PROTOS_H */
  147.  
  148.